<?
  include('../init.php');

  $aid= $_POST["aid"];
  
  $sql = "SELECT showcase_id,showcase_img_path FROM showcase_img WHERE showcase_img_id = '".$imgId."'";
  $line = $db->queryUniqueObject($sql);
  
  $db->execute("DELETE FROM showcase_img WHERE showcase_img_id = '$imgId'");
  
  if(file_exists('../../images/showcase/'.$line->showcase_id.'/'.$line->showcase_img_path)){
    unlink('../../images/showcase/'.$line->showcase_id.'/'.$line->showcase_img_path);
  }

  echo 'success';
?>